//
//  CameraView.h
//  iPhone SRV
//
//  Created by Nick Kitchener on 06/07/2009.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SRVController.h"
#import "SRVBlackfin.h"
#import "SRVOperationCompleteListener.h"
#import "SRVGetJPGFrameOperation.h"

@interface CameraView : UIView <SRVOperationCompleteListener> {
	id <SRVBlackfin> blackfin;
	
	// current image being displayed - note the image data isn't copied out of the operation.
	SRVGetJPGFrameOperation *displayedJPGOperation;
	NSData					*displayedImageData;	
	UIImage					*displayedImage;	
	
	SRVGetJPGFrameOperation *inprogressJPGOperation;

	bool switchImage;

	bool idle;
	NSTimer	*repeatingTimer;
}

@property(readwrite,assign) id<SRVBlackfin> blackfin;

-(void) drawRect: (CGRect) rect;

-(void)initiateNewImageOperation;

// JPG operation completed
-(void)operationCompleted:(SRVOperation *)operation;
-(void)operationFailed:(SRVOperation *)operation;

- (void)timerFireMethod:(NSTimer*)theTimer;

- (void)viewWillAppear;
- (void)viewWillDisappear;

@end
